﻿using UnityEngine;
using GraphProcessor;
using IQIGame.Onigao.Logic;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(SkillEditorConst.Trigger + "/" + SkillEditorConst.CustomProperty, typeof(SkillEditorGraph))]
    public class SkillTriggerNode_CustomProperty : SkillTriggerNode
    {
        [InspectorName("自定义属性类型")] public ECustomProperty propertyType;
        [SkillEditorNode("自定义Key", "CustomKey")]
        public string customKey;
        [InspectorName("触发值")] public int value;
        [InspectorName("是否仅限自己")] public bool onlySelf;
        protected override ESkillTriggerType type => ESkillTriggerType.CustomProperty;

        protected override SkillCustomConfig CreateConfig()
        {
            return new SkillTrigger_CustomProperty_ConfigData()
            {
                propertyType = (int)propertyType,
                customKey = this.customKey,
                value = this.value,
                onlySelf = this.onlySelf
            };
        }
    }
}